- if is_officer?
  = error_messages_for("raid")
  - form_tag(:controller => "raids", :action => "create") do
    %table
      %tr
        %td Zone
        %td= collection_select("raid", "zone_id", @zones, "id", "name")
      %tr
        %td Comment
        %td= text_field("raid", "comment", { :size => 40 })
      %tr
        %td Date
        %td= datetime_select("raid", "date")
      %tr
        %td
        %td= submit_tag("Create")

%br

%h3 Raids this week
%table
  %tr
    %th
    %th Starts at
    %th Comment
    %th Zone
  - @raids_this_week.each do |day_and_raids_on_this_day|
    %tr{:class => ((day_and_raids_on_this_day[0].yday + 1).odd? ? "odd" : "even")}
      %td= day_and_raids_on_this_day[0].strftime("%A")
      %td
      %td
      %td
    - day_and_raids_on_this_day[1].each do |r|
      %tr{:class => ((day_and_raids_on_this_day[0].yday + 1).odd? ? "odd" : "even")}
        %td
        %td= r.date.strftime("%H:%M")
        %td= r.comment
        %td= link_to(r.zone.name, { :controller => "raids", :action => "show", :id => r.id })

%h3 Raids next week
%table
  %tr
    %th
    %th Starts at
    %th Comment
    %th Zone
  - @raids_next_week.each do |day_and_raids_on_this_day|
    %tr{:class => (day_and_raids_on_this_day[0].yday.odd? ? "odd" : "even")}
      %td= day_and_raids_on_this_day[0].strftime("%A")
      %td
      %td
      %td
    - day_and_raids_on_this_day[1].each do |r|
      %tr{:class => (day_and_raids_on_this_day[0].yday.odd? ? "odd" : "even")}
        %td
        %td= r.date.strftime("%H:%M")
        %td= r.comment
        %td= link_to(r.zone.name, { :controller => "raids", :action => "show", :id => r.id })

- if (@past_raids.length > 0)
  %h3 Past raids
  - form_tag(:controller => "raids", :action => "delete") do
    %table
      %tr
        %th Date
        %th Comment
        %th Zone
        - if is_officer?
          %th= submit_tag("Delete")
      - @past_raids.each do |r|
        %tr{:class => (r.week.odd? ? "odd" : "even")}
          = render(:partial => r, :locals => { :raid => r, :size => 60})
          - if is_officer?
            %td= check_box_tag("deleteraid#{r.id}")
  = will_paginate(@past_raids)
